package com.grad.why.studentsystem.mapper;

import com.grad.why.studentsystem.domain.ChooseCourse;
import com.grad.why.studentsystem.domain.ChooseCourseExample;
import com.grad.why.studentsystem.domain.Student;
import com.grad.why.studentsystem.domain.current.CurrentChooseCourseInfo;
import com.grad.why.studentsystem.domain.current.CurrentStudentScoresInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ChooseCourseMapper {
    int countByExample(ChooseCourseExample example);

    int deleteByExample(ChooseCourseExample example);

    int deleteByPrimaryKey(Integer chooseid);

    int insert(ChooseCourse record);

    int insertSelective(ChooseCourse record);

    List<ChooseCourse> selectByExample(ChooseCourseExample example);

    ChooseCourse selectByPrimaryKey(Integer chooseid);

    int updateByExampleSelective(@Param("record") ChooseCourse record, @Param("example") ChooseCourseExample example);

    int updateByExample(@Param("record") ChooseCourse record, @Param("example") ChooseCourseExample example);

    int updateByPrimaryKeySelective(ChooseCourse record);

    int updateByPrimaryKey(ChooseCourse record);

    List<CurrentChooseCourseInfo> getChooseCourseInfos(@Param("offset") int offset,@Param("limit") int limit,@Param("search") String search);

    long getChooseCourseInfosLength(@Param("search") String search);

    int getMaxIChooseCourseId();

    int getCountOfStudentName(@Param("stuName") String stuName);

    int getStudentIdByStudentName(@Param("stuName") String stuName);

    int checkStudentIsExist(@Param("studentId") int studentId);

    List<Student> getStudentByCourseId(@Param("cid") Integer cid);

    int isExistChooseCourseInfo(@Param("chooseCourse") ChooseCourse chooseCourse);

    List<ChooseCourse> getChooseCourseByCid(@Param("courseid")Integer courseid);

    List<CurrentStudentScoresInfo> getStudentScoresListById(@Param("sid") Integer sid,@Param("offset")Integer offset,@Param("limit") Integer limit);

    int getStudentInfoByStudentName(@Param("sname") String sname);

    List<CurrentStudentScoresInfo> getStudentScoreByStudentName(@Param("sname") String sname,@Param("offset") Integer offset,@Param("limit") Integer limit);

    long getStudentScoresListByIdLength(@Param("sid") Integer sid);

    long getStudentScoreByStudentNameLength(@Param("sname") String sname);

    long insertEntity(@Param("chooseCourse") ChooseCourse chooseCourseinfo);

    List<CurrentChooseCourseInfo> getAllChooseCourseInfos();

    List<ChooseCourse> getChooseCoursesBySid(@Param("sid") int sid);
}